package com.hellobike.haxing.modules.wms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hellobike.haxing.modules.wms.entity.CodeHolderPoint;
import com.hellobike.haxing.modules.wms.mapper.CodeHolderPointMapper;
import com.hellobike.haxing.modules.wms.service.ICodeHolderPointService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: t_wms_code_holder_point
 * @Author: haxing-boot
 * @Date:   2020-01-15
 * @Version: V1.0
 */
@Service
public class CodeHolderPointServiceImpl extends ServiceImpl<CodeHolderPointMapper, CodeHolderPoint> implements ICodeHolderPointService {

    @Override
    public CodeHolderPoint getByCode(String pointCode, Long warehouseId) {
        CodeHolderPoint q = new CodeHolderPoint();
        q.setPointCode(pointCode);
        q.setWarehouseId(warehouseId);
        QueryWrapper<CodeHolderPoint> queryWrapper = new QueryWrapper<>(q);
        return baseMapper.selectOne(queryWrapper);
    }

    @Override
    public List<CodeHolderPoint> getByCurDocId(Long id) {
        CodeHolderPoint q = new CodeHolderPoint();
        q.setCurDocId(id);
        QueryWrapper<CodeHolderPoint> queryWrapper = new QueryWrapper<>(q);
        return baseMapper.selectList(queryWrapper);
    }
}
